package com.ewili.x.special.init;

import com.ewili.framework.service.inter.MailService;
import com.ewili.x.special.service.data.inter.*;
import com.ewili.x.special.service.strategy.inter.StrategyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Created by pangkunkun on 2017/9/3.
 * 这里通过设定value的值来指定执行顺序
 */
@Component
@Order(value = 1)
@Slf4j
public class MyApplicationRunner  implements ApplicationRunner {

    @Autowired
    private StockService stockService;

    @Autowired
    private HisRecordService hisRecordService;

    @Autowired
    private StrategyService strategyService;

    @Autowired
    private TradableShareHoldersService tradableShareHoldersService;

    @Autowired
    private MailService mailService;

    @Autowired
    private ExecsService execsService;

    @Autowired
    private ValueService valueService;

    @Autowired
    private ResearchReportService researchReportService;

    @Autowired
    private BlockTradingMarketService blockTradingMarketService;

    @Autowired
    private ExecsMarketService execsMarketService;

    @Autowired
    private BaiduEventService baiduEventService;

    @Autowired
    private AmountStockService amountStockService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        //http://data.eastmoney.com/executive/gdzjc-jzc.html 股东增减持数据
        //http://data.eastmoney.com/bbsj/yjbb/000606.html; 财务数据
        //http://data.eastmoney.com/DataCenter_V3/gdzjc.ashx?pagesize=50&page=1&js=var%20uzoftlkq&param=&sortRule=1&sortType=NOTICEDATE&tabid=all&code=&name=&rt=52238572 股东增减持

        //百度热点事件
        //baiduEventService.baiduEventSpide();

        //股票数据
        stockService.spideStock();

        //十大股东增减持，按季度计算
        tradableShareHoldersService.spideEastMoneyTradableHolder();

        //十大股东增减持，按季度计算
        //tradableShareHoldersService.spide163TradableShareHolder();

        //高管增减持
        execsService.spideExecs();

        //历史交易记录
        hisRecordService.spideHisRecord();

        //估值数据
        valueService.spideValue();

        //个股研究报告
        researchReportService.spideResearchReport();

        //市场大宗交易
        blockTradingMarketService.spideBlockTradingMarket();

        //市场高管增减持
        execsMarketService.spideExecsMarket();

        //股票资金
        amountStockService.spide();
    }
}
